<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style16/Level3outlineStyle3Bg.webp'" alt="" />
      <div class="outline">
        <div class="outline-title" v-html="textType(props.info.text)"></div>
        <div class="content-box">
          <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :infoData="props.info"
            :row="
              props.info.value && props.info.subTitle
                ? 3
                : !props.info.value && props.info.subTitle
                ? 7
                : props.info.value && !props.info.subTitle
                ? 4
                : 9
            "
          ></TextMax>
          <div
            class="outline-cover"
            v-if="props.info.value"
            @click="ImgVisible = true"
            @mouseenter="flag = true"
            @mouseleave="flag = false"
          >
            <img :src="urls + props.info.value + '?imageView2/3/w/898/h/460/format/webp'" alt="" />
          </div>
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style2/firstLevelOutline1Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free16Style3',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style16.vue';
const store = useProjectStore();
const ImgVisible = ref(false);
const flag = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
}
.shadow {
  width: 640px;
  height: 200px;
  position: absolute;
  bottom: 0;
  left: 0;
}
.flex-box {
  width: 400px;
  height: 684px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
  overflow: hidden;
}

.Showroom-parent {
  position: absolute;
  top: 16px;
  left: 53px;
  z-index: 23;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  z-index: 22;
  padding: 0 40px 220px 30px;
}
.outline-title2 {
  width: 36px !important;
  height: 368px !important;
  &::after {
    width: 44px !important;
    height: 376px !important;
  }
}
.outline-title {
  width: 180px;
  height: 76px;
  position: relative;
  flex-shrink: 0;
  margin-top: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: url(https://static.jiyi.show/free/style16/Level3outlineStyle3TitleBg.webp) no-repeat center/100% 100%;
  }
  &::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: url(https://static.jiyi.show/free/style16/Level3outlineStyle3TitleBg.webp) no-repeat center/100% 100%;
  }
  ::v-deep p {
    font-size: 20px;
    color: #8a7a6a;
    line-height: 30px;
    text-align: center;
    font-family: SourceHanSerifCN-Bold;
  }
}
.content-box {
  width: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.outline-subTitle {
  width: 100%;
  font-family: SourceHanSerifCN;
  font-size: 16px;
  color: #8a7a6a;
  line-height: 28px;
  margin-bottom: 8px;
  text-align: center;
}
.outline-content-hover {
  img {
    transform: scale(1.5);
  }
}

::v-deep .textMore-box {
  margin: 8px 0;
  flex: 1;
  display: flex;
  align-items: center;
}
.outline-cover {
  width: 100%;
  min-height: 130px;
  height: 100%;
  overflow: hidden;
  margin-top: 8px;
  &:hover img {
    transform: scale(1.5);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
  }
}
::v-deep .van-text-ellipsis {
  color: #333 !important;
  text-align: justify;
  font-family: 'PingFangSC';
  font-size: 16px;
  line-height: 28px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #333 !important;
  font-weight: 800 !important;
}
</style>